﻿using GuanQL.Core.Domain.System;
using GuanQL.Core.Stores;
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace GuanQL.DataMigration.Seeds
{
    public class MenuSeed : BaseSeed
    {
        public MenuSeed(GQLDbContext dbContext) : base(dbContext)
        {

        }

        public override async Task Seed()
        {
            await _dbContext.Set<Menus>().AddRangeAsync(AddMenus());

            await _dbContext.SaveChangesAsync();
        }

        string[] iconStr = new string[] { "glyphicon glyphicon-pencil" };

        public List<Menus> AddMenus()
        {
            var menus = new List<Menus>();

            var jczl = new Menus
            {
                Pid = Guid.Parse("00000000-0000-0000-0000-000000000000"),
                Icon = iconStr[0],
                Title = "基础资料",
                //Url = null,
                Order = 0
            };
            menus.Add(jczl);
            menus.Add(new Menus
            {
                Pid = jczl.Id,
                Icon = iconStr[0],
                Title = "手机品牌",
                Url = "Phone/Brand",
                Order = 0
            });
            menus.Add(new Menus
            {
                Pid = jczl.Id,
                Icon = iconStr[0],
                Title = "手机故障",
                Url = "Phone/fualt",
                Order = 1
            });
            menus.Add(new Menus
            {
                Pid = jczl.Id,
                Icon = iconStr[0],
                Title = "职员管理",
                Url = "Phone/fualt",
                Order =2
            });
            menus.Add(new Menus
            {
                Pid = jczl.Id,
                Icon = iconStr[0],
                Title = "职员管理",
                Url = "Phone/fualt",
                Order = 3
            });
            menus.Add(new Menus
            {
                Pid = jczl.Id,
                Icon = iconStr[0],
                Title = "权限分配",
                Url = "Phone/fualt",
                Order = 4
            });
            menus.Add(new Menus
            {
                Pid = jczl.Id,
                Icon = iconStr[0],
                Title = "客户资料",
                Url = "Phone/fualt",
                Order = 5
            });


            menus.Add(jczl);





            return menus;
        }
    }
}
